package uutalk.netcloud.talk.base.util;

import android.content.Context;
import android.media.AudioManager;
import android.media.SoundPool;

/**
 * Created by Administrator on 2017/7/24.
 */

public class SoundPlay {
    private static SoundPlay soundPlay;
    private SoundPool soundPool;

    public static SoundPlay getInstance() {
        if(soundPlay==null){
            soundPlay = new SoundPlay();
        }
        return soundPlay;
    }
    private SoundPlay(){
        soundPool = new SoundPool(10, AudioManager.STREAM_SYSTEM,5);
    }


    public void play(Context context,int soundId){
        soundPool.load(context,soundId,1);
        soundPool.play(1,1,1,0,0,1);
    }
}
